package com.yvtian.admin.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;

/**
 * 用户(TbUser)实体类
 *
 * @author long
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "sys_user")
public class SysUser extends Model<SysUser> implements Serializable {
    private static final long serialVersionUID = 658322548857776866L;
    /**
    * ID
    */
    @TableId(value = "id")
    private String id;
    /**
     * 账号
     */
    @TableField(value = "account")
    private String account;
    /**
    * 手机号码
    */
    @TableField(value = "mobile")
    private String mobile;
    /**
    * 密码
    */
//    @NotBlank(message = "密码不能为空")
    @TableField(value = "password")
    private String password;
    /**
    * 昵称
    */
    @NotBlank(message = "昵称不能为空")
    @TableField(value = "nickname")
    private String nickname;
    /**
    * 性别    1:男 0：女
    */
    @NotBlank(message = "性别不能为空")
    @TableField(value = "sex")
    private String sex;
    /**
    * 出生年月日(yyyy-MM-dd)
    */
//    @NotBlank(message = "出生日期不能为空")
    @TableField(value = "birthday")
    private String birthday;
    /**
    * 头像
    */
    @TableField(value = "avatar")
    private String avatar;
    /**
    * E-Mail
    */
    @TableField(value = "email")
    private String email;
    /**
    * 注册日期
    */
    @TableField(value = "regdate")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date regdate;
    @TableField(exist = false)
    private String regDateStr;

    /**
     * 部门Id
     */
    @TableField(value = "deptId")
    private Integer deptId;

    /**
    * 修改日期
    */
    @TableField(value = "updatedate")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatedate;
    /**
    * 最后登陆日期
    */
    @TableField(value = "lastdate")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastdate;
    /**
    * 在线时长（分钟）
    */
    @TableField(value = "online")
    private Long online;

    /**
     * 是否删除
     */
    @TableField(value = "is_delete")
    private Integer isDelete;

    /**
     * 是否启用
     */
    @TableField(value = "is_disable")
    private Integer isDisable;

    @TableField(exist = false)
    private ArrayList<SysRole> roles;

    @TableField(exist = false)
    private String deptName;

}
